package whu.o2o.widgets;

import android.app.Activity;
import android.util.Log;

public class MyDialog {

	public static CustomProgressDialog mDialog;

	public static void closeWaittingDialog() {
		if (mDialog != null && mDialog.isShowing()) {
			mDialog.dismiss();
		}
	}

	public static void showWaittingDailog(Activity context) {
		closeWaittingDialog();
		mDialog = CustomProgressDialog.createDialog(context);
		mDialog.show();

	}

	public static void showWaittingDailog(Activity context, String text) {
		if (context.isFinishing()) { // ������һ�С�
			Log.d("showWaittingDailog", "is finishing, will stop showing alert dialog.");
			return;
		}
		mDialog = CustomProgressDialog.createDialog(context);
		mDialog.setMessage(text);
		mDialog.show();
	}
}